$(function () {
    /*开始*/

    /*页面加载之后*/
    $(document).ready(function () {
        $("#content_register").hide().fadeIn(1000);
        $("#content_login").hide().fadeIn(1000);
    })

    $("#pasw").focusout(function () {
        var encrypt = new JSEncrypt();
        encrypt.setPublicKey("-----BEGIN PUBLIC KEY-----\n" +
            "MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgGDXzy1N5kQ49wm2Y6eMBGiojNbF\n" +
            "6ZowOmBmMA7tdkAIv1oxbSu/bf9xCJFZjoj+KCyf2+6C0JvTBm7022tt+U+pSKXS\n" +
            "3yEh+c0s+PaKJNjO9CFZwtF5B5x0c7bFWTHCwQyC6G/w9BhMN4TegL1cO8ut0d3o\n" +
            "7QQrDUN4n9n7uArnAgMBAAE=\n" +
            "-----END PUBLIC KEY-----");
        /*md5加密*/
        $val = md5($(this).val());
        $("#pasw").val(encrypt.encrypt($val));
    }).focus(function () {
        $(this).val("");
    })


    $("#code_verify>img").click(function () {
        var timestamp = new Date().getTime();
        $(this).attr("src", "/getcode"+"/"+timestamp);
    })

    $("#header").mouseenter(function () {
        $("#header nav").addClass("navbar-inverse")
        $("nav a").css("color","white")
        $("nav ul").css("background","black")
    }).mouseleave(function () {
        $("#header nav").removeClass("navbar-inverse")
        $("nav a").css("color","black")
        $("nav ul").css("background","")
    })

})